<template>
<div class="service">
  <iframe v-if="data.url" :src="data.url" class="service-iframe"></iframe>
  <div class="tip" v-else>暂无访问权限</div>
</div>
</template>

<script setup>
import { reactive } from 'vue'
import {onlineCustomer} from '@/api/interface/customer.js'

const data = reactive({
  url: '',
})

//获取当前登陆账户信息
const getAccountMessage = () => {
  onlineCustomer().then(res=>{
    if (res.status === 200) {
      sessionStorage.onlineToken = res.data.split('?')[1].split('=')[1]||''
      data.url = res.data.includes('null') ? '' : res.data
    }
  })
}
getAccountMessage()
</script>

<style lang="scss" scoped>
.service{
  display: flex;
  justify-content: center;
  align-items: center;
    height: 100%;
    .service-iframe{
      width: 100%;
      height: 100%;
      border: none;
    }
    .tip{
      font-size: 20px;
      font-weight: 700;
      color: #b9b9b9;
    }
}
</style>